package service

import (
	"context"
	"fmt"

	pb "com.damai.services/order/api"
	"com.damai.services/order/internal/conf"
)

type OrderServiceService struct {
	c *conf.Server
	pb.UnimplementedOrderServiceServer
}

func NewOrderServiceService(c *conf.Server) *OrderServiceService {
	return &OrderServiceService{
		c: c,
	}
}

func (s *OrderServiceService) GetOrder(ctx context.Context, req *pb.GetOrderRequest) (*pb.GetOrderReply, error) {
	return &pb.GetOrderReply{
		Orderno: fmt.Sprintf("you get order %v %s %v", req.Id, "orderno123123", s.c.Http.Addr),
	}, nil
}
